﻿#region Styx Namespaces
using Styx;
using Styx.Common;
using Styx.CommonBot;
using Styx.CommonBot.Routines;
using Styx.TreeSharp;
using Styx.WoWInternals;
using Styx.WoWInternals.DBC;
using Styx.WoWInternals.WoWObjects;
#endregion

namespace GiwinMonk
{
    public partial class Monk : CombatRoutine
    {
        public void InterruptSpell()
        {
            if (SpellManager.CanCast("Quaking Palm") &&
                StyxWoW.Me.CurrentTarget.IsWithinMeleeRange)
            {
                Logging.Write("Interrupting " +
                    StyxWoW.Me.CurrentTarget.CastingSpell.Name +
                    " using Spell Name: 'Quaking Palm'");
                InstantCast("Quaking Palm");
            }
            else if (SpellManager.CanCast("Spear Hand Strike") &&
                StyxWoW.Me.CurrentTarget.IsWithinMeleeRange)
            {
                Logging.Write("Interrupting " +
                    StyxWoW.Me.CurrentTarget.CastingSpell.Name +
                    " using Spell Name: 'Spear Hand Strike'");
                InstantCast("Spear Hand Strike");
            }
            else if (SpellManager.CanCast("Crackling Jade Lighting") &&
                StyxWoW.Me.CurrentTarget.Distance < 36.5)
            {
                Logging.Write("Interrupting " +
                    StyxWoW.Me.CurrentTarget.CastingSpell.Name +
                    " using Spell Name: 'Crackling Jade Lighting'");
                InstantCast("Crackling Jade Lighting");
            }
            else if (SpellManager.CanCast("Paralysis") &&
                StyxWoW.Me.CurrentTarget.IsWithinMeleeRange &&
                StyxWoW.Me.EnergyPercent >= 20)
            {
                Logging.Write("Interrupting " +
                    StyxWoW.Me.CurrentTarget.CastingSpell.Name +
                    " using Spell Name: 'Paralysis'");
                InstantCast("Paralysis");
            }
            else if (SpellManager.CanCast("Leg Sweep") &&
                StyxWoW.Me.CurrentTarget.Distance < 5)
            {
                Logging.Write("Interrupting " +
                    StyxWoW.Me.CurrentTarget.CastingSpell.Name +
                    " using Spell Name: 'Leg Sweep'");
                InstantCast("Leg Sweep");
            }
        }
    }
}
